function rest = randucbmdw(t,~,T,alphaK,betaK,sm,sw)

mvalue=[sm.m1(t,T),sm.m2(t,T),sm.m3(t,T),sm.m4(t,T),sm.m5(t,T),...
    sm.m6(t,T),sm.m7(t,T),sm.m8(t,T),sm.m9(t,T),sm.m10(t,T),...
    sm.m11(t,T),sm.m12(t,T),sm.m13(t,T),sm.m14(t,T),sm.m15(t,T),...
    sm.m16(t,T),sm.m17(t,T),sm.m18(t,T),sm.m19(t,T),sm.m20(t,T),...
    sm.m21(t,T),sm.m22(t,T),sm.m23(t,T),sm.m24(t,T),sm.m25(t,T),...
    sm.m26(t,T),sm.m27(t,T),sm.m28(t,T),sm.m29(t,T),sm.m30(t,T),...
    sm.m31(t,T),sm.m32(t,T),sm.m33(t,T),sm.m34(t,T),sm.m35(t,T),...
    sm.m36(t,T),sm.m37(t,T),sm.m38(t,T),sm.m39(t,T),sm.m40(t,T),...
    sm.m41(t,T),sm.m42(t,T),sm.m43(t,T),sm.m44(t,T),sm.m45(t,T),...
    sm.m46(t,T),sm.m47(t,T),sm.m48(t,T),sm.m49(t,T),sm.m50(t,T)];
wvalue=[sw.w1(t,T),sw.w2(t,T),sw.w3(t,T),sw.w4(t,T),sw.w5(t,T),...
    sw.w6(t,T),sw.w7(t,T),sw.w8(t,T),sw.w9(t,T),sw.w10(t,T),...
    sw.w11(t,T),sw.w12(t,T),sw.w13(t,T),sw.w14(t,T),sw.w15(t,T),...
    sw.w16(t,T),sw.w17(t,T),sw.w18(t,T),sw.w19(t,T),sw.w20(t,T),...
    sw.w21(t,T),sw.w22(t,T),sw.w23(t,T),sw.w24(t,T),sw.w25(t,T),...
    sw.w26(t,T),sw.w27(t,T),sw.w28(t,T),sw.w29(t,T),sw.w30(t,T),...
    sw.w31(t,T),sw.w32(t,T),sw.w33(t,T),sw.w34(t,T),sw.w35(t,T),...
    sw.w36(t,T),sw.w37(t,T),sw.w38(t,T),sw.w39(t,T),sw.w40(t,T),...
    sw.w41(t,T),sw.w42(t,T),sw.w43(t,T),sw.w44(t,T),sw.w45(t,T),...
    sw.w46(t,T),sw.w47(t,T),sw.w48(t,T),sw.w49(t,T),sw.w50(t,T)];
rest=zeros((alphaK+1)*(betaK+1),1);
rest(1:betaK+1)=0;
for ii=1:alphaK
    rest(ii*(betaK+1)+2:(ii+1)*(betaK+1))=wvalue(1:betaK)*mvalue(ii);
    
end
